<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - ViewController Interface Reference</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="http://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="http://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="http://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">ViewController Interface Reference</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Mon Aug 15 2016</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.10 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ViewController Interface Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="interface_view_controller.html">ViewController</a>  country_name;  showResults;</p>
<ul>
<li><p class="startli">(IBAction)buttonPressed:(id)sender { _ns1__GetAirportInformationByCountry sending; _ns1__GetAirportInformationByCountryResponse receiving; std::string result = ""; //stores resulting data bool webserviceresult = true; //keeps track of if the web service returns a readable result</p>
<p class="startli">airportSoapProxy service; soap_init(service.soap);</p>
<p class="startli">// --&mdash; register plugin for callbacks ---&mdash; soap_register_plugin(service.soap, soap_ios);</p>
<p class="startli">std::string countryname = std::string((char*)[country_name.text UTF8String]); sending.country = </p>
<p class="startli">std::ofstream out("/Users/bethanysanders/Documents/work/Air/Air/xmlmessage.txt"); std::ifstream in("/Users/bethanysanders/Documents/work/Air/Air/xmlmessage.txt");</p>
<p class="startli">if (service.GetAirportInformationByCountry(&amp;sending,receiving) == SOAP_OK) if (out.is_open()) out &lt;&lt; *(receiving.GetAirportInformationByCountryResult);</p>
<p class="startli">out.close();</p>
<p class="startli">struct soap *ctx = soap_new1(SOAP_C_UTFSTRING | SOAP_XML_INDENT | SOAP_DOM_TREE); ctx-&gt;double_format = "%lG";</p>
<p class="startli">xsd__anyType dom(ctx); if (in.is_open()) in &gt;&gt; dom; if (dom.soap-&gt;error) webserviceresult = false; xsd__anyType *elt;</p>
<p class="startli">for (xsd__anyType *it = dom.elt_get("Table"); it; it = it-&gt;get_next()) { xsd__anyType&amp; dom_Table = *it; if ((elt = dom_Table.elt_get("AirportCode"))) { xsd__anyType&amp; dom_Table_AirportCode = *elt; if (dom_Table_AirportCode.get_text()) { result += "\n\nAirport Code = "; result += dom_Table_AirportCode.get_text(); }</p>
<p class="startli">} if ((elt = dom_Table.elt_get("CityOrAirportName"))) { xsd__anyType&amp; dom_Table_CityOrAirportName = *elt; if (dom_Table_CityOrAirportName.get_text()) { result += "\nCity or Airport Name = "; result += dom_Table_CityOrAirportName.get_text(); } } if ((elt = dom_Table.elt_get("Country"))) { xsd__anyType&amp; dom_Table_Country = *elt; if (dom_Table_Country.get_text()) { result += "\nCountry = "; result += dom_Table_Country.get_text(); } } if ((elt = dom_Table.elt_get("CountryAbbrviation"))) { xsd__anyType&amp; dom_Table_CountryAbbrviation = *elt; if (dom_Table_CountryAbbrviation.get_text()) { result += "\nCountry Abbreviation = "; result += dom_Table_CountryAbbrviation.get_text(); } } if ((elt = dom_Table.elt_get("CountryCode"))) { xsd__anyType&amp; dom_Table_CountryCode = *elt; if (dom_Table_CountryCode.get_text()) { result += "\nCountry Code = "; result += dom_Table_CountryCode.get_text(); } } if ((elt = dom_Table.elt_get("GMTOffset"))) { xsd__anyType&amp; dom_Table_GMTOffset = *elt; if (dom_Table_GMTOffset.get_text()) { result += "\nGMT Offset = "; result += dom_Table_GMTOffset.get_text(); } } if ((elt = dom_Table.elt_get("RunwayLengthFeet"))) { xsd__anyType&amp; dom_Table_RunwayLengthFeet = *elt; if (dom_Table_RunwayLengthFeet.get_text()) { result += "\nRunway Length (feet) = "; result += dom_Table_RunwayLengthFeet.get_text(); } } if ((elt = dom_Table.elt_get("RunwayElevationFeet"))) { xsd__anyType&amp; dom_Table_RunwayElevationFeet = *elt; if (dom_Table_RunwayElevationFeet.get_text()) { result += "\nRunway Elevation (feet) = "; result += dom_Table_RunwayElevationFeet.get_text(); } } if ((elt = dom_Table.elt_get("LatitudeDegree"))) { xsd__anyType&amp; dom_Table_LatitudeDegree = *elt; if (dom_Table_LatitudeDegree.get_text()) { result += "\nLatitude Degree = "; result += dom_Table_LatitudeDegree.get_text(); } } if ((elt = dom_Table.elt_get("LatitudeMinute"))) { xsd__anyType&amp; dom_Table_LatitudeMinute = *elt; if (dom_Table_LatitudeMinute.get_text()) { result += "\nLatitude Minute = "; result += dom_Table_LatitudeMinute.get_text(); } } if ((elt = dom_Table.elt_get("LatitudeSecond"))) { xsd__anyType&amp; dom_Table_LatitudeSecond = *elt; if (dom_Table_LatitudeSecond.get_text()) { result += "\nLatitude Second = "; result += dom_Table_LatitudeSecond.get_text(); } } if ((elt = dom_Table.elt_get("LatitudeNpeerS"))) { xsd__anyType&amp; dom_Table_LatitudeNpeerS = *elt; if (dom_Table_LatitudeNpeerS.get_text()) { result += "\nLatitude N or S = "; result += dom_Table_LatitudeNpeerS.get_text(); } } if ((elt = dom_Table.elt_get("LongitudeDegree"))) { xsd__anyType&amp; dom_Table_LongitudeDegree = *elt; if (dom_Table_LongitudeDegree.get_text()) { result += "\nLongitude Degree = "; result += dom_Table_LongitudeDegree.get_text(); } } if ((elt = dom_Table.elt_get("LongitudeMinute"))) { xsd__anyType&amp; dom_Table_LongitudeMinute = *elt; if (dom_Table_LongitudeMinute.get_text()) { result += "\nLongitude Minute = "; result += dom_Table_LongitudeMinute.get_text(); } } if ((elt = dom_Table.elt_get("LongitudeSeconds"))) { xsd__anyType&amp; dom_Table_LongitudeSeconds = *elt; if (dom_Table_LongitudeSeconds.get_text()) { result += "\nLongitude Second = "; result += dom_Table_LongitudeSeconds.get_text(); } } if ((elt = dom_Table.elt_get("LongitudeEperW"))) { xsd__anyType&amp; dom_Table_LongitudeEperW = *elt; if (dom_Table_LongitudeEperW.get_text()) { result += "\nLongitude E or W = "; result += dom_Table_LongitudeEperW.get_text(); } } }</p>
<p class="startli">NSString *airPorts = [NSString stringWithUTF8String:result.c_str()]; if (result == "" || !webserviceresult) airPorts = [NSString stringWithFormat: "%", "Error: no know information. Try a different country."];</p>
<p class="startli">showResults.editable = NO; showResults.showsVerticalScrollIndicator = YES; showResults.text = airPorts;</p>
<p class="startli">soap_destroy(ctx); // delete objects soap_end(ctx); // delete DOM data soap_free(ctx); // free context</p>
<p class="startli">service.destroy(); }</p>
</li>
<li>(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. }</li>
<li>(void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</li>
</ul>
<p>You will notice there is much more code in this example's ViewController.mm. This is because this web service stores the whole XML response within a string instead of appropriate variables. The dom parser can fix this situation so that you can still access your results without having to parse the XML yourself. The dom code in this example was generated via command line in UNIX. To do so, once you have dom executable in your working directory, just execute the command </p><pre class="fragment">./domcpp -i airPorts.xml
</pre><p>where airPorts.xml is a file that stores an example xml response. The option -i is what tells the dom tool to generate the code you need to parse your result. To obtain an example XML response, test the web service on <a href="http://www.webservicex.net/New/Home/ServiceDetail/20">http://www.webservicex.net/New/Home/ServiceDetail/20</a>. </p>
</div><hr/>The documentation for this interface was generated from the following file:<ul>
<li><a class="el" href="_r_e_a_d_m_e_8md.html">README.md</a></li>
</ul>
</div><!-- contents -->
<hr class="footer">
<address class="footer">
Copyright (C) 2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Mon Aug 15 2016 14:03:07 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.10</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
